<?php
	require_once $_SERVER['DOCUMENT_ROOT'] . '/SAGER/logic/CustomCommand.php';
	require_once $_SERVER['DOCUMENT_ROOT'] . '/SAGER/model/factory/DaoFactory.php';
	
	require_once $_SERVER['DOCUMENT_ROOT'] . '/SAGER/model/entity/LegalClient.php';
	
	error_reporting (E_ALL ^ E_NOTICE);
	
	$debug = $_SESSION['debug'];
	
	/*
	* Class to create a legal client
	*/
	class CommandCreateLegalClient extends CustomCommand {
		/*
		* Constructor of the class
		*/
		public function __construct($pkRif, $name, $emailAddress) {
			$this -> legalClient = new LegalClient($pkRif, $name, $emailAddress);
		}
		
		/*
		* Method to execute to create a legal client
		*/
		public function execute() {
			$daoFactory = DaoFactory :: getMySqlDaoFactory();
			$incad = $daoFactory -> getMySqlLegalClientAccessDao();
			$legalClientCreation = $incad -> createLegalClient($this -> legalClient);
			
			$this -> result = $legalClientCreation;
		}
	}
?>